package StudentManage;

import java.util.ArrayList;
import java.util.Scanner;
public class Online {
	public void main(String [] args) {
		
		}
public void m() {
	
	ArrayList arr = new ArrayList();
	System.out.println("请选择客服端");
	System.out.println(" 1.老师");
	System.out.println(" 2.学生");
	System.out.println(" 3.退出");
	Scanner num = new Scanner(System.in);
	String num1 = num.nextLine();
	switch(num1) {
	case"1":
		teacher(arr);
		break;
	case"2":
		student(arr);
		break;
	case "3":
		//退出
		default:
		System.out.println("谢谢你的使用");
		System.exit(0);
		break;
	
	}
}

//教师类
	private void teacher(ArrayList arr) {
		Scanner input = new Scanner(System.in);
		String username;
		String password;
		
		do{	
		System.out.println("请输入账户");
		username = input.next();
		System.out.println("请输入密码");
		password = input.next();
			if(!(username.equals("teacher"))) {
				System.out.println("不存在此账号，请重新输入");
				
				}else if(!(password.equals("teacher"))){
					System.out.println("密码输入错误，请重新输入");
					password = input.next();;
				}
		}
		while(!(username.equals("teacher")&&password.equals("teacher")));
		}
	
			
	//学神
	private void student(ArrayList arr) {
		grades g =new grades();
		Scanner input = new Scanner(System.in);
		String username;
		String password;
		
		do{	
		System.out.println("请输入账户");
		username = input.next();
		System.out.println("请输入密码");
		password = input.next();
			if(!(username.equals("student"))) {
				System.out.println("不存在此账号，请重新输入");
				
				}else if(!(password.equals("student"))){
					System.out.println("密码输入错误，请重新输入");
					password = input.next();
				}
		}
		while(!(username.equals("student")&&password.equals("student")));
		g.g();
		}
	
	}
